package com.mfin.bs.services;

import com.mfin.bs.mgr.impl.TransactionManager;
import com.mfin.bs.mgr.interfaces.ICashBookManager;
import com.mfin.bs.mgr.interfaces.ITransactionManager;
import com.mfin.vo.CashbookVO;
import com.mfin.vo.finance.FinanceVO;

public class CashBookServicesImpl extends BaseImpl implements ICashBookServices {

	@Override
	public CashbookVO addEntry(FinanceVO financeVO, CashbookVO cashbook) {

		logMethodBegin("CashBookServicesImpl", "addEntry");

		ITransactionManager transaction = new TransactionManager();
		transaction.beginTransaction();

		ICashBookManager cashBookManager = getCashBookManager(transaction
				.getPersistenceGovernor());
		CashbookVO cashBookVO = cashBookManager
				.addEntry(financeVO, cashbook);

		transaction.commitTransaction();
		logMethodEnd("CashBookServicesImpl", "addEntry");
		return cashBookVO;
	}

}